import type { App } from "vue";
import { createI18n } from "vue-i18n";
// 本地语言包
import en from "./package/en";
import zh from "./package/zh";
import jp from "./package/jp";
import ru from "./package/ru";
import th from "./package/th";
import my from "./package/my";
// const appStore = useAppStoreHook();
const locale = localStorage.getItem("lang");
const messages = {
  "en-us": {
    ...en,
  },
  "zh-cn": {
    ...zh,
  },
  jp: {
    ...jp,
  },
  ru: {
    ...ru,
  },
  th: {
    ...th,
  },
  my: {
    ...my,
  },
};

const i18n = createI18n({
  locale: locale || "zh-cn",
  legacy: false,
  //   locale: appStore.language,
  messages: messages,
  globalInjection: true,
});

export default i18n;
